package com.kern.singleton;

/**
 *  单例模式: MyBusiness 只允许有一个实例
 * Created by caoshi at 8:00 2021-08-30
 */
public class MyBusiness {

    private static MyBusiness mb = new MyBusiness();

    private MyBusiness() {
    }


    /**
     *  俄汉式实现单例模式
     * @return
     */
    public static MyBusiness getInstance() {
//        if (mb == null)
//            return new MyBusiness();
        return mb;
    }
}
